package com.test.hj;



public class Main {

    public static void main(String[] args) {
    	Person p1 = new Person();
    	p1.work();
    	Person p2 = new Teacher();
    	p2.work();
    	Teacher t1 =new Teacher();
    	p1 = t1;
    	p1.work();
        System.out.println("hello world"); 
        
        myWork(new Person());
        myWork(new Teacher("李磊老师"));
        myWork(new Student());
        
    }
    
    public static void myWork(Person person){
    	System.out.println(person.getClass().toString());
    	person.work();
    }
}